home *** CD-ROM | disk | FTP | other *** search
- /*
- File: standard.h
-
- Contains: Standard definitions.
-
- Copyright: © 1991-1994 by Apple Computer, Inc., all rights reserved.
-
- */
-
- /* ********************************************************************* */
- /* * * */
- /* * "MPW C" Version * */
- /* * * */
- /* ********************************************************************* */
-
- #ifndef _standard_h_
-
-
- /* ********************************************************************* */
- /* * * */
- /* * The definitions that follow are what is considered to be the * */
- /* * standard UNIX definitions. * */
- /* * * */
- /* ********************************************************************* */
-
-
- /*
- ** Abbreviated type Definitions
- */
-
- typedef unsigned char uchar;
- typedef unsigned char *uPtr;
- typedef unsigned short ushort;
- typedef unsigned int uint;
- typedef unsigned long ulong;
-
- /*
- ** Standard Type Definitions
- */
-
- typedef unsigned char u_int_08;
- typedef unsigned int u_int_16;
- typedef unsigned long int u_int_32;
-
- typedef char s_int_08;
- typedef int s_int_16;
- typedef long int s_int_32;
-
-
- /*
- ** Convenient Coding Macros
- */
-
- #define forever for(;;)
-
- #define iter(i,max) for(i=0;i<max,i++)
-
- #define repeat do
- #define until(x) while(!(x))
-
- #define ifnot(x) if(!(x))
-
- #define max(a,b) (((a)>(b))?(a):(b)) /* caution - side effects */
- #define min(a,b) (((a)<(b))?(a):(b)) /* caution - side effects */
-
- #define uppercase(x) ((((x)>='a')&((x)<='z'))?((x)+'A'-'a'):(x))
- #define lowercase(x) ((((x)>='A')&((x)<='Z'))?((x)+'a'-'A'):(x))
-
- /* Returns number of elements in an array */
-
- #define countof(a) (sizeof(a)/sizeof((a)[0]))
-
- /* Returns a pointer to the first element in an array */
-
- #define startp(a) (&(a)[0])
-
- /* Returns a pointer to the last element in an array */
-
- #define endp(a) (&(a)[(sizeof(a)/sizeof((a)[0]))-1])
-
-
- #define _standard_h_
- #endif _standard_h_
-